# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jaewon

from coin.exchange.bithumb.ws.subscriber import BithumbMultiSubscriberWrapper
from coin.exchange.bithumb.ws.subscriber_v3 import BithumbSubscriber as BithumbV3Subscriber
from coin.strategy.mm.feed_builder import BithumbFlowBookBuilder
from coin.strategy.mm.feed_builder import BithumbV2FlowBookBuilder
from coin.strategy.mm.feed_builder import BithumbV3FlowBookBuilder
from coin.strategy.mm.base.feed import BaseFeedSubsystem
from coin.strategy.mm.subscription import SubscriptionRequest


class BithumbFeedSubsystem(BaseFeedSubsystem):
  FeedSubReq = SubscriptionRequest('Spot', 'Bithumb', None)
  FeedSubscriber = BithumbMultiSubscriberWrapper
  FlowBookBuilder = BithumbFlowBookBuilder

  def _init_subscriber(self):
    return super()._init_subscriber(subscriber_group_id='TBD')


class BithumbV2FeedSubsystem(BaseFeedSubsystem):
  FeedSubReq = SubscriptionRequest('Spot', 'Bithumb', 'v2')
  FeedSubscriber = BithumbMultiSubscriberWrapper
  FlowBookBuilder = BithumbV2FlowBookBuilder

  def _init_subscriber(self):
    return super()._init_subscriber(subscriber_group_id='TBD')

class BithumbV3FeedSubsystem(BaseFeedSubsystem):
  FeedSubReq = SubscriptionRequest('Spot', 'Bithumb', 'v3')
  FeedSubscriber = BithumbV3Subscriber
  FlowBookBuilder = BithumbV3FlowBookBuilder
